<template>
  <section class="smart-bill">
    <div class="common-text-block-section">
      <div data-v-1b5111bc="" class="title-section">
        <div data-v-1b5111bc="" class="title">
            提示
        </div>
        <div class="tip-texts">
          1、在每个月客户的账套结转过后，账务信息将同步至数据库中，可通过本功能导出总账和明细账
          <br />
          2、若本月账套未结转，则可查询至本月之前的账薄。
        </div>
      </div>
    </div>
    <section class="common-block-section">
      <header class="top-line">
        <div class="search-section">
          <el-input
            placeholder="请输入公司名称进行查询"
            v-model="searchParams.companyName"
            @keyup.enter.native="search"
            @clear="search"
            size="mini"
            suffix-icon="el-icon-search"
            clearable
          >
          </el-input>
        </div>
      </header>
      <type-table
        ref="firstTab"
        name="first"
        :type="0"
        :searchParams="searchParams"
        :activedName="activedName"
      />
    </section>
  </section>
</template>
<script>
/**
 * @file 智能做账
 */
import processStatistics from "@/components/process-statistics";
import typeTable from "./typeTable";
import map from "@/components/map";
import dataHelper from '@/pages/finance-auto/data.js';

export default {
  components: {
    processStatistics,
    typeTable,
  },
  data() {
    return {
      // 搜索参数
      searchParams: {
        // 公司名称
        companyName: "",
      },
      activedName: "first",
      boolList: map.boolList,
      // smartBillStatusList: map.accountStatusList,
      billStatusList: map.industryList,
      payTaxesTypeList: map.payTaxesTypeList,
      // 进度统计数据
      processStatisticsData: []
    };
  },
  mounted() {
    dataHelper.getData().then(data => {
      this.processStatisticsData = data;
      console.log("统计数据:", data);
    });
  },
  computed: {
    getActived() {
      return this.$refs[`${this.activedName}` + "Tab"];
    },
  },
  methods: {
    handleClick(tab, event) {
    },
    refresh() {
      const tab = this.getActived;
      if (tab) {
        tab.loadData(true);
      }
    },
    search(e) {
      this.$nextTick(() => {
        this.refresh();
      });
    },
    onTabChange(e) {
    }
  },
};
</script>

<style lang="less" scoped>
@import '../../assets/var.less';
.top-line {
  padding-bottom: 10px;
  text-align: right;
  > .el-button {
    float: left;
  }
  .search-section {
    .el-select {
      margin-top: 2px;
    }
    .el-input,
    .el-select {
      width: 180px;
    }
  }
}
.smart-bill {
  padding: 0 10px;
  .top-line {
    padding-bottom: 10px;
  }
  .pagination {
    text-align: right;
    padding: 20px 0 0;
  }
}
.tip-texts {
  padding: 0 20px 20px;
  font-size: 14px;
}
</style>
